package com.cebbank.yyi.springbootapp.jingtang.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
@Getter
public enum DocSystemIdEnum {

    JICHU("1", "基本管理制度", "1800409873200115714"),
    JUTI("2", "具体规章制度", "1800409902577020929");

    private final String oldId;

    private final String desc;

    private final String relId;

    public static DocSystemIdEnum getByCode(String oldId) throws Exception {
        for (DocSystemIdEnum e : DocSystemIdEnum.values()) {
            if (e.getOldId().equals(oldId)) {
                return e;
            }
        }
        throw new Exception("DocSystemIdEnum：老系统ID映射失败，当前OLD_ID为：" + oldId);
    }
}
